﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using System.ComponentModel.DataAnnotations;

namespace Admin.NET.Application;

/// <summary>
/// 编号规则基础输入参数
/// </summary>
public class NumberingrulesBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public virtual long? Id { get; set; }
    
    /// <summary>
    /// 目标表单
    /// </summary>
    public virtual string? Forms { get; set; }
    
    /// <summary>
    /// 编号前缀
    /// </summary>
    public virtual string? Prefix { get; set; }
    
    /// <summary>
    /// 时间规则
    /// </summary>
    public virtual string? TimeRules { get; set; }
    
    /// <summary>
    /// 流水号/位
    /// </summary>
    public virtual int? Serialnumber { get; set; }
    
    /// <summary>
    /// 步长
    /// </summary>
    public virtual int? Increments { get; set; }
    
    /// <summary>
    /// 编号生成规则
    /// </summary>
    public virtual string? GenerateRules { get; set; }
    
    /// <summary>
    /// 操作人
    /// </summary>
    public virtual long? Operator { get; set; }
    
    /// <summary>
    /// 操作时间
    /// </summary>
    public virtual DateTime? OperatingTime { get; set; }
    
}

/// <summary>
/// 编号规则分页查询输入参数
/// </summary>
public class PageNumberingrulesInput : BasePageInput
{
    /// <summary>
    /// 目标表单
    /// </summary>
    public string? Forms { get; set; }
    
    /// <summary>
    /// 编号前缀
    /// </summary>
    public string? Prefix { get; set; }
    
    /// <summary>
    /// 时间规则
    /// </summary>
    public string? TimeRules { get; set; }
    
    /// <summary>
    /// 流水号/位
    /// </summary>
    public int? Serialnumber { get; set; }
    
    /// <summary>
    /// 步长
    /// </summary>
    public int? Increments { get; set; }
    
    /// <summary>
    /// 编号生成规则
    /// </summary>
    public string? GenerateRules { get; set; }
    
    /// <summary>
    /// 操作人
    /// </summary>
    public long? Operator { get; set; }
    
    /// <summary>
    /// 操作时间范围
    /// </summary>
     public DateTime?[] OperatingTimeRange { get; set; }
    
    /// <summary>
    /// 选中主键列表
    /// </summary>
     public List<long> SelectKeyList { get; set; }
}

/// <summary>
/// 编号规则增加输入参数
/// </summary>
public class AddNumberingrulesInput
{
    /// <summary>
    /// 目标表单
    /// </summary>
    [MaxLength(32, ErrorMessage = "目标表单字符长度不能超过32")]
    public string? Forms { get; set; }
    
    /// <summary>
    /// 编号前缀
    /// </summary>
    [MaxLength(32, ErrorMessage = "编号前缀字符长度不能超过32")]
    public string? Prefix { get; set; }
    
    /// <summary>
    /// 时间规则
    /// </summary>
    [MaxLength(32, ErrorMessage = "时间规则字符长度不能超过32")]
    public string? TimeRules { get; set; }
    
    /// <summary>
    /// 流水号/位
    /// </summary>
    public int? Serialnumber { get; set; }
    
    /// <summary>
    /// 步长
    /// </summary>
    public int? Increments { get; set; }
    
    /// <summary>
    /// 编号生成规则
    /// </summary>
    [MaxLength(32, ErrorMessage = "编号生成规则字符长度不能超过32")]
    public string? GenerateRules { get; set; }
    
    /// <summary>
    /// 操作人
    /// </summary>
    public long? Operator { get; set; }
    
    /// <summary>
    /// 操作时间
    /// </summary>
    public DateTime? OperatingTime { get; set; }
    
}

/// <summary>
/// 编号规则删除输入参数
/// </summary>
public class DeleteNumberingrulesInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
}

/// <summary>
/// 编号规则更新输入参数
/// </summary>
public class UpdateNumberingrulesInput
{
    /// <summary>
    /// 主键Id
    /// </summary>    
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
    /// <summary>
    /// 目标表单
    /// </summary>    
    [MaxLength(32, ErrorMessage = "目标表单字符长度不能超过32")]
    public string? Forms { get; set; }
    
    /// <summary>
    /// 编号前缀
    /// </summary>    
    [MaxLength(32, ErrorMessage = "编号前缀字符长度不能超过32")]
    public string? Prefix { get; set; }
    
    /// <summary>
    /// 时间规则
    /// </summary>    
    [MaxLength(32, ErrorMessage = "时间规则字符长度不能超过32")]
    public string? TimeRules { get; set; }
    
    /// <summary>
    /// 流水号/位
    /// </summary>    
    public int? Serialnumber { get; set; }
    
    /// <summary>
    /// 步长
    /// </summary>    
    public int? Increments { get; set; }
    
    /// <summary>
    /// 编号生成规则
    /// </summary>    
    [MaxLength(32, ErrorMessage = "编号生成规则字符长度不能超过32")]
    public string? GenerateRules { get; set; }
    
    /// <summary>
    /// 操作人
    /// </summary>    
    public long? Operator { get; set; }
    
    /// <summary>
    /// 操作时间
    /// </summary>    
    public DateTime? OperatingTime { get; set; }
    
}

/// <summary>
/// 编号规则主键查询输入参数
/// </summary>
public class QueryByIdNumberingrulesInput : DeleteNumberingrulesInput
{
}

/// <summary>
/// 下拉数据输入参数
/// </summary>
public class DropdownDataNumberingrulesInput
{
    /// <summary>
    /// 是否用于分页查询
    /// </summary>
    public bool FromPage { get; set; }
}

/// <summary>
/// 编号规则数据导入实体
/// </summary>
[ExcelImporter(SheetIndex = 1, IsOnlyErrorRows = true)]
public class ImportNumberingrulesInput : BaseImportInput
{
    /// <summary>
    /// 目标表单
    /// </summary>
    [ImporterHeader(Name = "目标表单")]
    [ExporterHeader("目标表单", Format = "", Width = 25, IsBold = true)]
    public string? Forms { get; set; }
    
    /// <summary>
    /// 编号前缀
    /// </summary>
    [ImporterHeader(Name = "编号前缀")]
    [ExporterHeader("编号前缀", Format = "", Width = 25, IsBold = true)]
    public string? Prefix { get; set; }
    
    /// <summary>
    /// 时间规则
    /// </summary>
    [ImporterHeader(Name = "时间规则")]
    [ExporterHeader("时间规则", Format = "", Width = 25, IsBold = true)]
    public string? TimeRules { get; set; }
    
    /// <summary>
    /// 流水号/位
    /// </summary>
    [ImporterHeader(Name = "流水号/位")]
    [ExporterHeader("流水号/位", Format = "", Width = 25, IsBold = true)]
    public int? Serialnumber { get; set; }
    
    /// <summary>
    /// 步长
    /// </summary>
    [ImporterHeader(Name = "步长")]
    [ExporterHeader("步长", Format = "", Width = 25, IsBold = true)]
    public int? Increments { get; set; }
    
    /// <summary>
    /// 编号生成规则
    /// </summary>
    [ImporterHeader(Name = "编号生成规则")]
    [ExporterHeader("编号生成规则", Format = "", Width = 25, IsBold = true)]
    public string? GenerateRules { get; set; }
    
    /// <summary>
    /// 操作人 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? Operator { get; set; }
    
    /// <summary>
    /// 操作人 文本
    /// </summary>
    [ImporterHeader(Name = "操作人")]
    [ExporterHeader("操作人", Format = "", Width = 25, IsBold = true)]
    public string OperatorFkDisplayName { get; set; }
    
    /// <summary>
    /// 操作时间
    /// </summary>
    [ImporterHeader(Name = "操作时间")]
    [ExporterHeader("操作时间", Format = "", Width = 25, IsBold = true)]
    public DateTime? OperatingTime { get; set; }
    
}
